#ifndef IMLOGINDLG_H
#define IMLOGINDLG_H

#include "../Core/msgbus_interface.h"
#include <QDialog>
#include <string>
#include <set>

using namespace NetMsgBus;
namespace Ui {
    class IMLoginDlg;
}

class IMLoginDlg : public QDialog
{
    Q_OBJECT

public:
    explicit IMLoginDlg(QWidget *parent = 0);
    ~IMLoginDlg();
    void setLoginName(const std::string& uid);
    void setLoginErrInfo(const QString& errinfo);
signals:
    void DoLogin(std::string userid, std::string encryptPass, int loginstate);
    void initloginList();
    void LoginShowed();

public slots:
    void OnLoginBtn();
    void OnLoginFailed(QString);
    void OnLoginOK(MsgBusParam);

    void OnInitLoginList();

protected:
    virtual void showEvent(QShowEvent * event);
private slots:
    void on_password_edit_textChanged(const QString &arg1);

private:
    Ui::IMLoginDlg *ui;
    QString m_shellStartLoginName;
    std::string encryptpass;
    std::set<QString> m_loginlist;
};

#endif // IMLOGINDLG_H
